#!/usr/bin/env node

const {Transform} = require('stream'),
      stdin = process.stdin,
      stdout = process.stdout;
let t1 = new Transform();
t1._transform = function(chunk,encoding,callback){
  this.push(Buffer.from(chunk.toString('utf8').toUpperCase()));
  callback();
}//_transform是Transform里面的固有方法

stdin.pipe(t1).pipe(stdout);//t1是转换流对象
